﻿@model Entities.Risk
@{
    ViewBag.Title = "TODO: Добавить риск";
}
<h2>
    Добавление риска</h2>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Новый риск</legend>
        <div class="editor-label">
            @Html.LabelFor(model => model.RiskFactor.Title)
        </div>
        @Html.DropDownListFor(model => model.RiskId, new SelectList(ViewBag.RiskFactors, "RiskId", "Title"))
        <div class="editor-label" style="display: none">
            @Html.LabelFor(model => model.ProjectId)
        </div>
        <div class="editor-field" style="display: none">
            @Html.EditorFor(model => model.ProjectId)
            @Html.ValidationMessageFor(model => model.ProjectId)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Probability)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Probability)
            @Html.ValidationMessageFor(model => model.Probability)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Cost)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Cost)
            @Html.ValidationMessageFor(model => model.Cost)
        </div>
        <p>
            <input type="submit" value="Добавить" />
        </p>
    </fieldset>
}
<div>
    @Html.ActionLink("К проекту", "ViewDetails", "Project", new { id = Model.ProjectId }, null)
</div>
